# Maintainer: Will Sinatra <wpsinatra@gmail.com>
pkgname=ruby-resolv-replace
_gemname=${pkgname#ruby-}
pkgver=0.1.1
pkgrel=0
pkgdesc="Replace Socket DNS with Resolv."
url="https://rubygems.org/gems/resolv-replace"
arch="noarch"
license="BSD-2-Clause"
depends="ruby ruby-resolv"
source="$pkgname-$pkgver.tar.gz::https://github.com/ruby/resolv-replace/archive/refs/tags/v$pkgver.tar.gz
	gemspec.patch"
builddir="$srcdir/$_gemname-$pkgver"
options="!check" #no checks defined

prepare() {
	default_prepare

	sed -i '/spec.signing_key/d' $_gemname.gemspec
}

build() {
	gem build $_gemname.gemspec
}

package() {
	local gemdir="$pkgdir/$(ruby -e 'puts Gem.default_dir')"

	gem install --local \
		--install-dir "$gemdir" \
		--ignore-dependencies \
		--no-document \
		--verbose \
		$_gemname

	rm -r "$gemdir"/cache \
		"$gemdir"/build_info \
		"$gemdir"/doc
}

sha512sums="
ee14ea5c81d9eadd0db2ec623b216741b226ae675f8befe2ec227f187197848e4b5380de551d34ad71541f0656933703e871f052a3a5f958b7484d976e2018a1  ruby-resolv-replace-0.1.1.tar.gz
08636b775c9db2baf775dcafb9a1e057193b438ca9702b8d3f8c0c6b9f634e16cc77c629b623cd17de18c37c74b2f59e2762abbfafce738de212f082c88ca049  gemspec.patch
"
